﻿using System.Threading.Tasks;
using RotovapPlatform.Domain.Common;
using RotovapPlatform.Domain.Equipment.Device.Valves.Dto;

namespace RotovapPlatform.Domain.Equipment.Interfaces.Base
{
	/// <summary>
	/// 切换阀基础接口
	/// </summary>
	public interface IValveBase : IEquipmentBase
	{
		/// <summary>
		/// 查询当前通道位置
		/// </summary>
		/// <returns>当前通道位置</returns>
		Task<int> GetCurrentChannelAsync();

		/// <summary>
		/// 切换到指定通道
		/// </summary>
		/// <param name="channel">目标通道</param>
		/// <returns>操作结果</returns>
		Task<OperationResult> SwitchToChannelAsync(int channel);

		/// <summary>
		/// 切换到指定通道并等待完成
		/// </summary>
		/// <param name="channel">目标通道</param>
		/// <param name="timeoutMs">超时时间(毫秒)</param>
		/// <returns>操作结果</returns>
		Task<OperationResult> SwitchToChannelAndWaitAsync(int channel, int timeoutMs = 10000);

		/// <summary>
		/// 复位
		/// </summary>
		/// <returns>操作结果</returns>
		Task<OperationResult> ResetAsync();

		/// <summary>
		/// 获取阀门状态
		/// </summary>
		/// <returns>阀门状态</returns>
		Task<ValveStatus> GetValveStatusAsync();
	}
}